package com.wn.ziroom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wn.ziroom.entity.Villages;
import com.wn.ziroom.mapper.VillagesMapper;
import com.wn.ziroom.service.VillagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangzhijia
 * @since 2023-02-23 02:27:54
 */
@Service
public class VillagesServiceImpl extends ServiceImpl<VillagesMapper, Villages> implements VillagesService {

    private VillagesMapper villagesMapper;

    @Autowired
    public void setVillagesMapper(VillagesMapper villagesMapper) {
        this.villagesMapper = villagesMapper;
    }

    @Override
    public List<Villages> findListByStreetCode(Integer streetCode) {
        QueryWrapper<Villages> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("streetCode",streetCode);
        return villagesMapper.selectList(queryWrapper);
    }
}
